1. Field of the Invention
This invention relates to a memory management system and method for categorizing memory resources depending upon whether they belong to a first or a second category. More specifically, the present invention relates to a system and method for accessing pointers pointing to memory resources to be utilized, and for storing those pointers at one of two designated areas depending upon the category of the pointers and/or the contents of the memory resources that the pointers point to.
2. Related Art
Since the advent of computer science, various techniques for managing and arranging data have been devised. Two notable examples of such techniques are the stack and the queue. In a stack, data (which can represent, e.g., a memory address) is "pushed" (i.e., stored) into some memory resource (typically comprising one or more physical memory locations) such that when data is subsequently requested from these memory resources, the last unit of data to be pushed is then "popped" (i.e., read). Thus, data is both pushed and popped only at one end (i.e., the "top") of the stack so that the Last one In is the First one Out (LIFO).
In a queue, however, the units of data are stored sequentially, so that new data is stored at one end of this sequence, while data that are subsequently requested are read and removed from the other end. In this way, the First one In is the First one Out (FIFO). Since the memory resources comprising the queue are progressively and sequentially used and data is written to and taken from the queue, it is often the case that the queue will be made "circular." This means that each memory resource is uniquely linked to two other memory resources, and that all of the memory resources used for the queue are linked together in a circular fashion so that memory resources can be used again and again.
In many ways, queues and stacks serve as excellent data management techniques, since they are simple, quick and easy to use. However, they can often be inflexible and inadequate if more than one category of data needs to be stored. For example, assume it is the policy of an airline to give first class seats to its economy class passengers in the event that 1) the airline overbooked economy class and 2) there are no more economy class seats available. Assume further that both first class and economy seats may free-up as people cancel or don't show up during the pre-flight time period.
Initially, data representing economy class and first class seats can be arranged in a queue or stack so that economy class seats will be the first ones out, with the first class seats placed behind them. That way, only when the quantity of economy class seats are used up will the first class seats be taken from the queue or stack. However, as both first class and economy seats free-up, it will be desired to return them to the queue or stack. Using a conventional queue or stack, there is no way to put each category of seat in an appropriate place, since a stack and a queue only allow data to be written at the beginning or the end, respectively, of their respective storage areas.
It is true that for the above-mentioned example, multiple queues and/or stacks can be used to achieve the desired result. However, additional data management would be required to maintain such an arrangement.
Thus, what is needed is a system and method for flexibly and efficiently allowing multiple categories of data to be managed.